#ifndef vr_vision_ruler_h
#define vr_vision_ruler_h
#include <INIReader.h>
#include <vision_ruler/GlobalUtil.h>
#include <vision_ruler/ProjectUtil.h>
#include <vision_ruler/common.h>
#include <vision_ruler/distortion_correction.h>

#include <vector>

#include "flashai/commons/box.h"

namespace vision_ruler {
class VisionRuler {
 public:
  VisionRuler();
  ~VisionRuler();
  int doRectify;
  int loggerLevel;
  std::vector<camera_info> cameraInfos;
  head_info headInfo;
  void initFromConfigFile(INIReader& reader,
                          std::string section = "vision_ruler");
  void computeDistance(std::vector<flashai::commons::Box>& boxes,
                       vision_ruler::global_info ginfo, int camera_info_id = 0);
  void obtain3DPosition(std::vector<box_info>& boxes);
  Distortion_Correction_Util distortion_Correction_Util;
  ProjectUtil projectUtil;
  GlobalUtil globalUtil;

 private:
  std::map<int, std::pair<float, float>> class_id_to_shape_;
  std::map<int, int> class_id_to_type_;
};
}  // namespace vision_ruler

#endif
